package com.ruoyi.framework.config.properties;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;


public class TenantProperties {

    private static TenantProperties instance;

    private Boolean enable = true;

    private String defaultTenantId = "000000";

    /**
     * 多租户字段名称
     */
    private String column = "tenant_id";

    /**
     * 多租户系统数据表
     */
    private List<String> ignoreTables = new ArrayList<>();


    private TenantProperties() {
    }

    public static TenantProperties getInstance() {
        if (instance == null) {
            instance = new TenantProperties();
            instance.getIgnoreTables().addAll(Arrays.asList("sys_menu", "sys_config", "sys_dict_data", "sys_dict_type", "sys_role_data_rule", "gen_table", "columns", "tables", "sys_post", "sys_notice",
                    "gen_table_column", "sys_role_menu", "sys_logininfor", "sys_tenant", "sys_user", "sys_user_post", "sys_role_dept", "sys_role_menu", "sys_role", "sys_dept", "sys_user_role", "sys_job", "sys_job_log", "sys_oper_log"
                    ,"sys_deploy"
                    ,"sys_expression"
                    ,"sys_form"
                    ,"sys_listener"
                    ,"act_app_appdef"
                    ,"act_app_databasechangelog"
                    ,"act_app_databasechangeloglock"
                    ,"act_app_deployment"
                    ,"act_app_deployment_resource"
                    ,"act_cmmn_casedef"
                    ,"act_cmmn_databasechangelog"
                    ,"act_cmmn_databasechangeloglock"
                    ,"act_cmmn_deployment"
                    ,"act_cmmn_deployment_resource"
                    ,"act_cmmn_hi_case_inst"
                    ,"act_cmmn_hi_mil_inst"
                    ,"act_cmmn_hi_plan_item_inst"
                    ,"act_cmmn_ru_case_inst"
                    ,"act_cmmn_ru_mil_inst"
                    ,"act_cmmn_ru_plan_item_inst"
                    ,"act_cmmn_ru_sentry_part_inst"
                    ,"act_co_content_item"
                    ,"act_co_databasechangelog"
                    ,"act_co_databasechangeloglock"
                    ,"act_dmn_databasechangelog"
                    ,"act_dmn_databasechangeloglock"
                    ,"act_dmn_decision"
                    ,"act_dmn_deployment"
                    ,"act_dmn_deployment_resource"
                    ,"act_dmn_hi_decision_execution"
                    ,"act_evt_log"
                    ,"act_fo_databasechangelog"
                    ,"act_fo_databasechangeloglock"
                    ,"act_fo_form_definition"
                    ,"act_fo_form_deployment"
                    ,"act_fo_form_instance"
                    ,"act_fo_form_resource"
                    ,"act_ge_bytearray"
                    ,"act_ge_property"
                    ,"act_hi_actinst"
                    ,"act_hi_attachment"
                    ,"act_hi_comment"
                    ,"act_hi_detail"
                    ,"act_hi_entitylink"
                    ,"act_hi_identitylink"
                    ,"act_hi_procinst"
                    ,"act_hi_taskinst"
                    ,"act_hi_tsk_log"
                    ,"act_hi_varinst"
                    ,"act_id_bytearray"
                    ,"act_id_group"
                    ,"act_id_info"
                    ,"act_id_membership"
                    ,"act_id_priv"
                    ,"act_id_priv_mapping"
                    ,"act_id_property"
                    ,"act_id_token"
                    ,"act_id_user"
                    ,"act_procdef_info"
                    ,"act_re_deployment"
                    ,"act_re_model"
                    ,"act_re_procdef"
                    ,"act_ru_actinst"
                    ,"act_ru_deadletter_job"
                    ,"act_ru_entitylink"
                    ,"act_ru_event_subscr"
                    ,"act_ru_execution"
                    ,"act_ru_external_job"
                    ,"act_ru_history_job"
                    ,"act_ru_identitylink"
                    ,"act_ru_job"
                    ,"act_ru_suspended_job"
                    ,"act_ru_task"
                    ,"act_ru_timer_job"
                    ,"act_ru_variable"
                    ,"flw_channel_definition"
                    ,"flw_ev_databasechangelog"
                    ,"flw_ev_databasechangeloglock"
                    ,"flw_event_definition"
                    ,"flw_event_deployment"
                    ,"flw_event_resource"
                    ,"flw_ru_batch"
                    ,"flw_ru_batch_part","t_terminal_history_data"
                    ,"t_device_ledger","t_file_video","t_video_spectrum" ,"t_device"
                    ,"sys_deploy_form","dw_pressure_configuration"));
        }
        return instance;
    }

    public static void setInstance(TenantProperties instance) {
        TenantProperties.instance = instance;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public String getDefaultTenantId() {
        return defaultTenantId;
    }

    public void setDefaultTenantId(String defaultTenantId) {
        this.defaultTenantId = defaultTenantId;
    }

    public String getColumn() {
        return column;
    }

    public void setColumn(String column) {
        this.column = column;
    }

    public List<String> getIgnoreTables() {
        return ignoreTables;
    }

    public void setIgnoreTables(List<String> ignoreTables) {
        this.ignoreTables = ignoreTables;
    }

}
